]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspace: Don't allow closing windows with attached modals
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 8 May 2014 09:21:34 +0000 (11:21 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 28 May 2014 20:01:54 +0000 (22:01 +0200)
Modal dialogs prevent the parent from being closed in "normal mode",
so it makes sense to not allow it in the overview either.

https://bugzilla.gnome.org/show_bug.cgi?id=729886

js/ui/workspace.js

index 2c49d6096aa405cf796ef8c16025650797e5a6fe..51b7e84f265be0f3fc2bd1d563c93f7ab6e4de6f 100644 (file)
@@ -200,6 +200,10 @@ const WindowClone = new Lang.Class({
         this.emit('size-changed');
     },
 
+    hasAttachedDialogs: function() {
+        return this.actor.get_n_children() > 1;
+    },
+
     _doAddAttachedDialog: function(metaWin, realWin) {
         let clone = new Clutter.Clone({ source: realWin });
         clone._updateId = metaWin.connect('size-changed', Lang.bind(this, function() {
@@ -582,7 +586,8 @@ const WindowOverlay = new Lang.Class({
     },
 
     _windowCanClose: function() {
-        return this._windowClone.metaWindow.can_close();
+        return this._windowClone.metaWindow.can_close() &&
+               !this._windowClone.hasAttachedDialogs();
     },
 
     _onWindowAdded: function(workspace, win) {